package com.sk.weichat.view;

import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;

import com.scwang.smartrefresh.layout.api.RefreshHeader;
import com.scwang.smartrefresh.layout.api.RefreshKernel;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.constant.RefreshState;
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
import com.sk.weichat.R;

/**
 * @author lzs
 * @date 2019/10/31
 * Email:343067508@qq.com
 **/
public class MyHeader implements RefreshHeader {
    Context context;

    public MyHeader(Context context) {
        this.context = context;
    }

    @NonNull
    @Override
    public View getView() {
        View view = LayoutInflater.from(context).inflate(R.layout.layout1, null);
        return view;
    }

    @NonNull
    @Override
    public SpinnerStyle getSpinnerStyle() {
        return null;
    }

    @Override
    public void setPrimaryColors(int... colors) {

    }

    @Override
    public void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDragHeight) {
        Log.e("lzs","onInitialized");
    }

    @Override
    public void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight) {
        Log.e("lzs","onMoving");
    }

    @Override
    public void onReleased(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) {
        Log.e("lzs","onReleased");
    }

    @Override
    public void onStartAnimator(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) {

    }

    @Override
    public int onFinish(@NonNull RefreshLayout refreshLayout, boolean success) {
        Log.e("lzs","onFinish");
        return 0;
    }

    @Override
    public void onHorizontalDrag(float percentX, int offsetX, int offsetMax) {
        Log.e("lzs","onHorizontalDrag");
    }

    @Override
    public boolean isSupportHorizontalDrag() {
        Log.e("lzs","isSupportHorizontalDrag");
        return false;
    }

    @Override
    public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) {
        Log.e("lzs","onStateChanged");
    }
}
